﻿using NthDownload.Contracts.Plugins.BandwidthProviders;

namespace NthDownload.BandwidthProviderPlugins
{
    public class SpeedLimitBandwidthProviderFactory : IBandwidthProviderFactory
    {
        private readonly string _pluginGUID;

        public SpeedLimitBandwidthProviderFactory(string pluginGUID)
        {
            _pluginGUID = pluginGUID;
        }

        public IBandwidthProvider CreateBandwidthProvider()
        {
            SpeedLimitBandwidthProvider newBandwidthProvider = new SpeedLimitBandwidthProvider();
            newBandwidthProvider.GUID = System.Guid.NewGuid().ToString();
            newBandwidthProvider.ParentGUID = _pluginGUID;
            newBandwidthProvider.Name = "New Speed Limit";

            return newBandwidthProvider;
        }
    }
}
